//
//  MicroWebsiteViewController.m
//  werfgh
//
//  Created by 李晓勇 on 14-9-17.
//  Copyright (c) 2014年 dingshenwangluokeji. All rights reserved.
//


#import "ZifViewController.h"
#import "NetAccess.h"
#import "AFNetworking.h"
#import "MBProgressHUD.h"
#import "Header.h"
#import "HgViewController.h"
//#import "LogViewController.h"
@interface ZifViewController ()<UITextFieldDelegate,NSURLConnectionDataDelegate,UIAlertViewDelegate>

@end

@implementation ZifViewController

{
    UITextField *_field;
    UITextField *_field1;
    UITextField *_field2;
    UITextField *_field3;
    UILabel*_labelTime;
    NSTimer *_timer;
    NSMutableData *_data;
    UIAlertView *_alertView;
    NSString *_string;
    UIImageView *_imageView;
    MBProgressHUD *pro;
    NSUserDefaults *users;
    NSString*_name;
    NSString*_word;
    NetAccess *net;
    UIButton* _btn2;
    BOOL verificationbool;
    //时间
    int intTime;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
-(void)match
{
    //    pro = [[MBProgressHUD alloc] initWithView:self.view];
    //    pro.labelText = @"正在加载中..";
    //    pro.mode = MBProgressHUDModeText;
    //    [self.view addSubview:pro];
    //    [pro showAnimated:YES whileExecutingBlock:^{
    //        [NSThread sleepForTimeInterval:2.0];
    //    } completionBlock:^{
    //        [[NSNotificationCenter defaultCenter]postNotificationName:@"textFieldgg" object:users];
    //    }];
    pro=[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    _field3.text =nil;
    _field1.text =nil;
    _field2.text =nil;
    [_timer invalidate];
}
-(void)addBack
{
    UIImageView*imgV=[[UIImageView alloc]init];
    imgV.frame=CGRectMake(0, 0, DeviceWidth, 20);
    imgV.image=[UIImage imageNamed:@"zhuangtailan.png"];
    imgV.userInteractionEnabled=YES;
    [self.view addSubview:imgV];
    
    UIImageView*imgV1=[[UIImageView alloc]init];
    imgV1.frame=CGRectMake(0, 20, DeviceWidth, 44);
    imgV1.image=[UIImage imageNamed:@"navgationbar.png"];
    imgV1.userInteractionEnabled=YES;
    [self.view addSubview:imgV1];
    
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(20, 10, 28, 28);
    UILabel *titleLab=[[UILabel alloc]init];
    titleLab.frame=CGRectMake(0, 0, DeviceWidth, 44);
    titleLab.font=[UIFont systemFontOfSize:20];
    titleLab.backgroundColor=[UIColor clearColor];
    titleLab.textColor= [UIColor whiteColor];
    titleLab.text=@"找回密码";
    titleLab.textAlignment=1;
    [imgV1 addSubview:titleLab];
    [backBtn setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
    [imgV1 addSubview:backBtn];
    //    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    //    self.navigationItem.leftBarButtonItem = backItem;
    
    // Do any additional setup after loading the view.
    
}
-(void)doBack:(id)sender
{
    NSLog(@"...rr%@",_field.text);
    _block1(_field.text);
    [self dismissViewControllerAnimated:YES completion:nil];
    
}

-(void)virds
{
    self.view.backgroundColor=[UIColor whiteColor];
    if(IOS7)
    {
        self.automaticallyAdjustsScrollViewInsets =NO;
        // 不透明的操作栏<br
        self.extendedLayoutIncludesOpaqueBars =NO;
        self.edgesForExtendedLayout =UIRectEdgeNone;
        self.modalPresentationCapturesStatusBarAppearance = NO;
        //设置状态栏
    }
    
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    net =[NetAccess sharedNetAccess];
    verificationbool=NO;
   // [self addBack];
    [self virds];
    intTime=60;
    
    [self controllersd];
    [self textfieldld];
    [self addImageView];
}
-(void)textfieldld
{
    
    
    UIImageView*VerificationImgV=[[UIImageView alloc]init];
    VerificationImgV.frame=CGRectMake(20,100,180,40);
    VerificationImgV.userInteractionEnabled=YES;
    VerificationImgV.image=[UIImage imageNamed:@"suruyanzhenma.png"];
    [self.view addSubview:VerificationImgV];
    
    _field =[[UITextField alloc]init ];
    _field.frame=CGRectMake(0, 0, VerificationImgV.frame.size.width, VerificationImgV.frame.size.height);
    _field.backgroundColor =[UIColor clearColor];
    
    // _field.clearButtonMode=UITextFieldViewModeAlways;
    // _field.placeholder = @"请输入您的手机号码";
    _field.text=self.phoneString;
//    _field.userInteractionEnabled=NO;
    _field.keyboardType=UIKeyboardTypeNumberPad;
    _field.delegate=self;
    _field.text=self.phoneString;
    [VerificationImgV addSubview:_field];
    
    _btn2=[UIButton buttonWithType:UIButtonTypeCustom];
    _btn2.tag=100;
    _btn2.frame=CGRectMake(VerificationImgV.frame.origin.x+VerificationImgV.frame.size.width,VerificationImgV.frame.origin.y, 100, VerificationImgV.frame.size.height) ;
    _btn2.backgroundColor=[UIColor colorWithRed:0.2f green:0.6f blue:0.9f alpha:1];
    [_btn2 setTitle:@"获取语音验证码" forState:UIControlStateNormal];
    [_btn2 setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
    _btn2.titleLabel.font=[UIFont systemFontOfSize:14];
    [self.view addSubview:_btn2];
    
    [_btn2 addTarget:self action:@selector(btnClick2) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    _field1 =[[UITextField alloc]initWithFrame:CGRectMake(20,VerificationImgV.frame.origin.y+55, DeviceWidth-40,_field.frame.size.height)];
    _field1.borderStyle =UITextBorderStyleRoundedRect;
    _field1 .delegate =self;
    //    _field1.backgroundColor=[UIColor whiteColor];
    //    _field1.background=[UIImage imageNamed:@"surukuang1.png"];
    _field1.clearButtonMode=UITextFieldViewModeAlways;
    _field1.placeholder = @"验证码:";
    _field1.keyboardType=UIKeyboardTypeNumberPad;
    [self.view addSubview:_field1];
    _labelTime=[[UILabel alloc]initWithFrame:CGRectMake(_btn2.frame.origin.x+_btn2.frame.size.height/2-_field1.frame.size.height/2, 0, _field1.frame.size.height, _field1.frame.size.height)];
    _labelTime.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"yuanquan.png"]];
    _labelTime.text=@"30s";
    
    _labelTime.hidden=YES;
  //  [_field1 addSubview:_labelTime];
    _field2 =[[UITextField alloc]initWithFrame:CGRectMake(20,_field1.frame.origin.y+55, DeviceWidth-40,_field.frame.size.height)];
    _field2.delegate =self;
    _field2.borderStyle =UITextBorderStyleRoundedRect;
    _field2.secureTextEntry =YES;
    _field2.placeholder = @"修改密码:";
    _field2.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:_field2];
    
    _field3 =[[UITextField alloc]initWithFrame:CGRectMake(20,_field2.frame.origin.y+55, DeviceWidth-40,_field.frame.size.height)];
    _field3.delegate =self;
    _field3.borderStyle =UITextBorderStyleRoundedRect;
    _field3.secureTextEntry =YES;
    _field3.placeholder = @"确认密码:";
    _field3.clearButtonMode=UITextFieldViewModeAlways;
    [self.view addSubview:_field3];
  
}

-(void)addImageView
{
    //    _imageView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"114.png"]];
    //    _imageView.frame =CGRectMake(115, 20 ,90, 90);
    //    [self.view addSubview:_imageView];
    
    UIButton *btn =[UIButton buttonWithType:UIButtonTypeCustom];
    btn .frame =CGRectMake(20, _field3.frame.origin.y+55, _field3.frame.size.width, _field.frame.size.height);
    btn.backgroundColor =[UIColor colorWithRed:0.2f green:0.6f blue:0.9f alpha:1];
    [btn setTitle:@"提交" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btn.layer.cornerRadius =10;
    btn.tag=1001;
    [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
    
    UIButton *btn1 =[UIButton buttonWithType:UIButtonTypeCustom];
    btn1 .frame =CGRectMake(20, btn.frame.origin.y+55, btn.frame.size.width, btn.frame.size.height);
    btn1.backgroundColor =[UIColor colorWithRed:0.2f green:0.6f blue:0.9f alpha:1];
    [btn1 setTitle:@"返回" forState:UIControlStateNormal];
    [btn1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btn1.layer.cornerRadius =10;
    
    [btn1 addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn1];
    
    
    UILabel*messageLab=[[UILabel alloc]init];
    messageLab.frame=CGRectMake(0, btn.frame.origin.y+btn.frame.size.height+15, DeviceWidth/2+15, 20);
    messageLab.textAlignment=2;
    messageLab.backgroundColor=[UIColor clearColor];
    messageLab.text=@"收不到短信？使用";
   // [self.view addSubview:messageLab];
    
    UILabel*messageLab1=[self labelForSize:@"语音验证"];
    messageLab1.frame=CGRectMake(messageLab.frame.size.width, messageLab.frame.origin.y, messageLab1.frame.size.width, messageLab.frame.size.height);
   // [self.view addSubview:messageLab1];
    messageLab1.userInteractionEnabled=YES;
    UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(voice)];
    [messageLab1 addGestureRecognizer:tap];
    
    
}

-(void)voice
{
    verificationbool=YES;
    [self btnClick2];
}
-(UILabel *)labelForSize:(NSString*)str
{
    UILabel *label=[[UILabel alloc]init];
    label.text=str;
    //label.textAlignment=1;
    label.numberOfLines=0;
    label.backgroundColor=[UIColor clearColor];
    label.textColor=[UIColor redColor];
    [label setLineBreakMode:NSLineBreakByCharWrapping];
    // label.font=[UIFont fontWithName:@"Courier-Bold" size:22];
    label.backgroundColor=[UIColor clearColor];
    CGRect bounds=[label textRectForBounds:CGRectMake(0, 0, 4000, 44) limitedToNumberOfLines:0];
    label.frame=bounds;
    
    
    return label;
    
}




-(void)btnClick2
{
   
    intTime=60;
    if (_field.text.length==11) {
        [self getYanZhengMa];
    }
    else
    {
        UIAlertView*alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"请输入正确的手机号码" delegate:nil
    cancelButtonTitle:@"确定"  otherButtonTitles:nil, nil];
        [alert show];
    }
    
    
}
-(void)btnClick:(UIButton*)sender
{
    
    NSLog(@"heheh");
    
    if(![net haveNet])
    {
        [pro removeFromSuperview];
        UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"提示" message:@"无网络连接" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [alertView show];
        
        
        
    }
    else
    {
        NSLog(@"111111%@%@",_field.text,_field1.text);
        if (IOS5) {
            if (!(_field3.text||_field1.text||_field2.text))
            {
                [pro removeFromSuperview];
                _alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请确保每一项不为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
                [_alertView show];
            }
            else{
                if (![_field3.text isEqualToString:[NSString stringWithFormat:@"%@",_field2.text]]) {
                    _field3.text=@"";
                    _field2.text=@"";
                    [pro removeFromSuperview];
                    _alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"新密码不一致" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
                    [_alertView show];
                    
                }
                else
                {
                    [self getShuJu];
                }}
        }
        else
        {
            
            if ([_field3.text isEqualToString:@""]||[_field1.text isEqualToString:@""]||[_field2.text isEqualToString:@""])
            {
                [pro removeFromSuperview];
                _alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请确保每一项不为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
                
                [_alertView show];
                
            }
            else
            {
                if (![_field3.text isEqualToString:[NSString stringWithFormat:@"%@",_field2.text]])
                {
                    NSLog(@"111%@222%@",_field2.text,_field3.text);
                    _field3.text=@"";
                    _field2.text=@"";
                    [pro removeFromSuperview];
                    _alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"新密码不一致" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
                    [_alertView show];
                    
                }
                else
                {
                    [self getShuJu];
                }
            }
        }}
}
- (BOOL)checkTel:(NSString *)str

{
    
    if ([str length] == 0) {
        [pro removeFromSuperview];
        UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"提醒", nil) message:NSLocalizedString(@"手机号为空", nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        
        [alert show];
        
        
        return NO;
        
    }
    
    //1[0-9]{10}
    
    //^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$
    
    //    NSString *regex = @"[0-9]{11}";
    
    NSString *regex = @"^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$";
    
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    
    BOOL isMatch = [pred evaluateWithObject:str];
    
    if (!isMatch) {
        [pro removeFromSuperview];
        UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请输入正确的手机号码" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        alert.tag=37;
        [alert show];
        
        
        
        return NO;
        
    }
    
    
    
    return YES;
    
}


-(void)getTime:(NSTimer*)timer
{
    NSLog(@"...11www");
//    _labelTime.hidden=NO;
//    _labelTime.textAlignment=1;
  
  _btn2.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//设置button的内容横向居中
   NSString*str=[NSString stringWithFormat:@"%ds",intTime--];
    [_btn2 setTitle:str forState:UIControlStateNormal];
//    [_btn2 setTitleColor:[UIColor colorWithRed:0.2f green:0.6f blue:0.9f alpha:1] forState:UIControlStateNormal];
     _btn2.titleLabel.font=[UIFont systemFontOfSize:20];
//    intTime--;
    if (intTime==-1) {
        [timer invalidate];
        [_btn2 setTitle:@"获取语音验证码" forState:UIControlStateNormal];
         _btn2.backgroundColor=[UIColor colorWithRed:0.2f green:0.6f blue:0.9f alpha:1];
         _btn2.titleLabel.font=[UIFont systemFontOfSize:14];
        _btn2.enabled=YES;
        
    }
    
}


-(void)getYanZhengMa
{
    if(![net haveNet])
    {
        [pro removeFromSuperview];
        UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"提示" message:@"无网络连接" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [alertView show];
        
        
        
    }
    
    else
    {
        NSLog(@".._%@",_field.text);
        
        _btn2.enabled=NO;
        _btn2.backgroundColor=[UIColor grayColor];
        
        _timer= [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(getTime:) userInfo:nil repeats:YES];
        NSLog(@"....%@",_field.text);
        NSString *str=[NSString stringWithFormat:@"http://testcmcc.leehuu.cn/api/Account/GetValidateCodeNoUser?SrcPhone=%@",_field.text];
        
        NSURL *url = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
        NSMutableURLRequest*request=[[NSMutableURLRequest alloc]initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0f];
        AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
        [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
            NSString *html = operation.responseString;//@"{\"retCode\":-1,\"exception\":\"密码错误！\"}";
            NSData* data=[html dataUsingEncoding:NSUTF8StringEncoding];
            if (data==nil) {
                return ;
            }
            id dict=[NSJSONSerialization  JSONObjectWithData:data options:0 error:nil];
            NSLog(@"获取到的数据为：%@",dict);
           
            if (![[dict objectForKey:@"success"]boolValue])
            {
                
                [pro removeFromSuperview];
                NSString* retString=[dict objectForKey:@"message"];
                UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:retString delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
                
                [alertView show];
                
            }
            else
                //信息正确
            {
                [pro removeFromSuperview];
                NSString*stringverification;
               
                    stringverification=@"请注意接听电话";
               
                UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:stringverification delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
                
                [alertView show];
                
            }
        }failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            
            [pro removeFromSuperview];
            UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"网络信号不好" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
            
            [alertView show];
        }];
        
        NSOperationQueue *queue = [[NSOperationQueue alloc] init];
        [queue addOperation:operation];
        
    }}



-(void)getShuJu
{
    
    NSLog(@"wohao %@   %@   %@",_field.text,_field1.text, _field2.text);
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://testcmcc.leehuu.cn/api/vosoem/EditePassword?userName=%@&vCode=%@&newPwd=%@",_field.text,_field1.text, _field2.text]];
    
    //第二步，创建请求
    
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60];

    AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
    [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSString *html = operation.responseString;
        NSData* data=[html dataUsingEncoding:NSUTF8StringEncoding];
        if (data==nil) {
            [pro removeFromSuperview];
            UIAlertView*alertV=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"服务暂不可用，请稍后查询" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
            [alertV show];
        }
        else
        {
            id dic= [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
            
            NSLog(@"...%@",dic);
            NSString*stringRecode=[dic objectForKey:@"retCode"];
            NSString*strException=[dic objectForKey:@"exception"];
            if ([stringRecode intValue]) {
                [pro removeFromSuperview];
                UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:strException delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
                alertView.tag=35;
                [alertView show];
            }
            else
            {
                [pro removeFromSuperview];
                UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"密码重置成功" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
                alertView.tag=36;
                [alertView show];
                
            }
            

            
            
        }
        
    }failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [pro removeFromSuperview];
        UIAlertView*alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"网络繁忙，请稍后再试" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
        [alert show];
    }];
    NSOperationQueue *queue = [[NSOperationQueue alloc] init];
    [queue addOperation:operation];
    
        
    }



-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    //UIAlertView*alert=(UIAlertView*)[self.view viewWithTag:33 ];
    if (alertView.tag==36) {
        if (buttonIndex==0) {
            NSLog(@"...rr%@",_field.text);
            _block1(_field.text);
            [self dismissViewControllerAnimated:YES completion:nil];
        }
    }
    if (alertView.tag==37) {
        if (buttonIndex==0)
        {
            _field.text=@"";
            
        }
    }
    
}

#pragma mark--网络代理方法

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [_field3 resignFirstResponder];
    [_field1 resignFirstResponder];
    [_field2 resignFirstResponder];
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
-(void)controllersd
{
    users =[NSUserDefaults standardUserDefaults];
    NSArray *array =[users objectForKey:@"users"];
    NSDictionary *dict =[array objectAtIndex:0];
    
    _name =[dict objectForKey:@"username"];
    _word=[dict objectForKey:@"userword"];
    //    _phoneName=[dict objectForKey:@"usercellphone" ];
    //dicts=[users objectForKey:@"Dic"];
    NSLog(@"qq%@%@",_name,_word);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)textFieldDidBeginEditing:(UITextField *)textField{   //开始编辑时，整体上移
    //    if (textField.tag==0) {
    //        [self moveView:-20];
    //    }
    //    if (textField.tag==1)
    //    {
    [self moveView:-80];
    //    }
}
-(void)textFieldDidEndEditing:(UITextField *)textField{     //结束编辑时，整体下移
    //    if (textField.tag==0) {
    //        [self moveView:20];
    //    }
    //    if (textField.tag==1)
    //    {
    [self moveView:80];
    //    }
}
-(void)moveView:(float)move{
    NSTimeInterval animationDuration = 0.30f;
    CGRect frame = self.view.frame;
    frame.origin.y+=move;//view的X轴上移
    self.view.frame = frame;
    [UIView beginAnimations:@"ResizeView" context:nil];
    [UIView setAnimationDuration:animationDuration];
    self.view.frame = frame;
    [UIView commitAnimations];//设置调整界面的动画效果
    
    
}


@end

